package eddy.yang;

import java.applet.Applet;
import java.applet.AppletContext;
import java.applet.AppletStub;
import java.applet.AudioClip;
import java.awt.Image;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Enumeration;
import java.util.Iterator;

import javax.swing.JFrame;

public class AppletFrame extends JFrame implements AppletStub, AppletContext{

   private Applet applet;
   
   public AppletFrame(Applet anApplet) {
      applet = anApplet;
      add(applet);
      applet.setStub(this);
   }
   
   public void setVisible(boolean b) {
      if(b) {
         applet.init();
         super.setVisible(true);
         applet.start();
      }
      else {
         applet.stop();
         super.setVisible(true);
         applet.destroy();
      }
   }
   
   public void appletResize(int width, int height) {
      // TODO Auto-generated method stub
      
   }

   public AppletContext getAppletContext() {
      // TODO Auto-generated method stub
      return null;
   }

   public URL getCodeBase() {
      // TODO Auto-generated method stub
      return null;
   }

   public URL getDocumentBase() {
      // TODO Auto-generated method stub
      return null;
   }

   public String getParameter(String name) {
      // TODO Auto-generated method stub
      return null;
   }

   public Applet getApplet(String name) {
      // TODO Auto-generated method stub
      return null;
   }

   public Enumeration<Applet> getApplets() {
      // TODO Auto-generated method stub
      return null;
   }

   public AudioClip getAudioClip(URL url) {
      // TODO Auto-generated method stub
      return null;
   }

   public Image getImage(URL url) {
      // TODO Auto-generated method stub
      return null;
   }

   public InputStream getStream(String key) {
      // TODO Auto-generated method stub
      return null;
   }

   public Iterator<String> getStreamKeys() {
      // TODO Auto-generated method stub
      return null;
   }

   public void setStream(String key, InputStream stream) throws IOException {
      // TODO Auto-generated method stub
      
   }

   public void showDocument(URL url) {
      // TODO Auto-generated method stub
      
   }

   public void showDocument(URL url, String target) {
      // TODO Auto-generated method stub
      
   }

   public void showStatus(String status) {
      // TODO Auto-generated method stub
      
   }

}
